<!-- page heading start-->
<div class="page-heading ng-scope">
	<ul class="breadcrumb">
		<li><a href="#"> 首页 </a></li>
		<li><a href="#"> 参数管理 </a></li>
		<li class="active"> 操作权限</li>
	</ul>
</div>
<!-- page heading end-->
<div class="row">
    <div class="col-lg-12">
        <section class="panel">
            <header class="panel-heading"> 
           		<span ng-if="addOrEdit == true" > 编辑操作权限 </span>
            	<span ng-if="addOrEdit == false" > 添加操作权限  </span>
            </header>
            <div class="panel-body">
                <form class="form-horizontal" role="form" name="permissionForm">
					<input type="text" ng-hide="true" ng-model="permission.id" name="id">
					<input type="text" ng-hide="true" ng-model="permission.p_menu_id" name="id">
                    <div class="form-group" ng-class="{'has-error':myForm.p_name.$dirty && myForm.p_name.$invalid}">
                        <label for="inputTypeName" class="col-lg-2 col-sm-2 control-label">操作名称</label>
                        <div class="col-lg-10">
                            <input type="text" class="form-control" id="inputTypeName" ng-model="permission.p_name"
								name="p_name" ng-required="true" ng-maxlength="30" ng-minlength="2" placeholder="请输入操作名称">
                            <label for="inputTypeName" 
                            ng-show="permissionForm.p_name.$dirty && permissionForm.p_name.$error.minlength" class="alert alert-danger help-block">* 长度不能少于2位</label>
                            <label for="inputTypeName"  
                            ng-show="permissionForm.p_name.$dirty && permissionForm.p_name.$error.maxlength" class="alert alert-danger help-block">* 长度不能超过30位</label>
                        </div>
                    </div>
                    
                    <div class="form-group" ng-class="{'has-error':myForm.p_value.$dirty && myForm.p_value.$invalid}">
                        <label for="inputTypeName" class="col-lg-2 col-sm-2 control-label">权限标识</label>
                        <div class="col-lg-10">
                            <input type="text" class="form-control" id="inputTypeName" ng-model="permission.p_value"
								name="p_value" ng-required="true" ng-maxlength="60" ng-minlength="2" placeholder="请输入权限标识">
                            <label for="inputTypeName"  
                            ng-show="permissionForm.p_value.$dirty && permissionForm.p_value.$error.minlength" class="alert alert-danger help-block">* 长度不能少于2位</label>
                            <label for="inputTypeName" 
                            ng-show="permissionForm.p_value.$dirty && permissionForm.p_value.$error.maxlength" class="alert alert-danger help-block">* 长度不能超过60位</label>
                        </div>
                    </div>
                    
                    <div class="form-group" ng-class="{'has-error':myForm.p_path.$dirty && myForm.p_path.$invalid}">
                        <label for="inputTypeName" class="col-lg-2 col-sm-2 control-label">执行路径</label>
                        <div class="col-lg-10">
                            <input type="text" class="form-control" id="inputTypeName" ng-model="permission.p_path"
								name="p_path" ng-required="true" ng-maxlength="60" ng-minlength="2" placeholder="请输入执行路径">
                            <label for="inputTypeName" 
                            ng-show="permissionForm.p_path.$dirty && permissionForm.p_path.$error.minlength" class="alert alert-danger help-block">* 长度不能少于2位</label>
                            <label for="inputTypeName" 
                            ng-show="permissionForm.p_path.$dirty && permissionForm.p_path.$error.maxlength" class="alert alert-danger help-block">* 长度不能超过60位</label>
                        </div>
                    </div>
					<div class="form-group" ng-class="{'has-error':myForm.p_description.$dirty && myForm.p_description.$invalid}">
						<label class="col-lg-2 col-sm-2 control-label">说明</label>
						<div class="col-lg-10">
							<textarea ck-editor class="form-control ckeditor" ng-model="permission.p_description" name="p_description" 
								ng-required="true" ng-maxlength="200"></textarea>
							<div ng-show="permissionForm.p_description.$dirty && permissionForm.p_description.$error.maxlength"
								class="alert alert-danger help-block"> 最多能输入200字 </div>
						</div>
					</div>
                    
                    <div class="form-group" ng-class="{'has-error':myForm.p_sort.$dirty && myForm.p_sort.$invalid}">
                        <label for="inputTypeValue" class="col-lg-2 col-sm-2 control-label">排序</label>
                        <div class="col-lg-10">
                           	<input type="text" ng-pattern="/^[1-9]\d*/" autocomplete="off"
								ng-required="true" ng-maxlength="5" id="doc-ipt-4"
								ng-model="permission.p_sort" name="p_sort" class="form-control" placeholder="排序">
							<div ng-show="permissionForm.p_sort.$dirty && permissionForm.p_sort.$error.maxlength"
								class="alert alert-danger help-block">长度不能超过5位</div>
							<div ng-show="permissionForm.p_sort.$dirty && permissionForm.p_sort.$error.pattern"
								class="alert alert-danger help-block">必须为数字</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-10">
							<button class="btn btn-danger" ng-disabled="permissionForm.$invalid"
								ng-click="save()">保存</button>
							<button type="reset" class="btn btn-default" ng-click="back()">取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </section>
    </div>
</div>
